home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / utility / fm45.zip / PATHINFO.TXT < prev    next >
Text File  |  1992-04-06  |  6KB  |  109 lines

  1.  
  2.  
  3.              INFORMATION ON THE DOS ENVIRONMENT PATH STRING
  4.              ----------------------------------------------
  5.  
  6.           All versions of PC and MS DOS above 2.0 maintain an area in 
  7.      memory called the environment.  The environment contains a series of 
  8.      text strings that are used by DOS and applications programs for 
  9.      various purposes.  You can see what strings are currently in the 
  10.      enviroment by typing SET and pressing <RETURN> from the DOS level.  As 
  11.      a minimum, the environment will contain the string COMSPEC= followed 
  12.      by a DOS directory path and (usually) COMMAND.COM.  Most hard disk 
  13.      equipped machines will show the following COMSPEC string:
  14.  
  15.                          COMSPEC=C:\COMMAND.COM
  16.  
  17.           Other strings that frequently appear in the environment are the 
  18.      PROMPT= and PATH= strings.  Control of the environment is effected
  19.      through the DOS SET command, which may be entered at the DOS level or 
  20.      from a batch (like AUTOEXEC.BAT) file.  For example, if a user desired 
  21.      that DOS used a copy of COMMAND.COM that was in a directory named
  22.      C:\DOS, he/she might place the command SET COMSPEC=C:\DOS\COMMAND.COM 
  23.      in the AUTOEXEC.BAT file.  After booting, DOS would load COMMAND.COM 
  24.      from C:\DOS each time it needed to reload the command interpreter.  
  25.      All other copies of COMMAND.COM in the system would be superfluous and 
  26.      ignored by DOS.
  27.           One very useful string that can be placed in the DOS environment 
  28.      by the user is the PATH= string.  When the name of an executable file 
  29.      is issued from the DOS level, DOS will first look in the current 
  30.      subdirectory for the file.  If it finds it, it loads and executes it 
  31.      and all is fine.  If it cannot find the file in the current directory, 
  32.      DOS will search the environment for the PATH= designator.  If one 
  33.      exists, DOS will start searching the system directories that are in the
  34.      PATH= string for the executable file.  For example, suppose that
  35.      the AUTOEXEC.BAT contains the command SET PATH=C:\DOS;D:\UTIL;E:\JUNK.
  36.      Note that directory path names are separated by semicolons and can 
  37.      (and should) include the drive designator.  Now further suppose that 
  38.      the user is in a directory named D:\SOMENAME and desires to run the 
  39.      program MYPROG.EXE, but MYPROG.EXE is not located in D:\SOMENAME.
  40.      When the user enters MYPROG, DOS, unable find it in the current
  41.      directory, starts searching the directories in the PATH= string 
  42.      starting with C:\DOS.  If MYPROG.EXE was in D:\UTIL, DOS would load 
  43.      and execute the program and D:\UTIL would be the active directory when 
  44.      the program received control from DOS.  Obviously, if DOS cannot find 
  45.      MYPROG.EXE in any of directories in the PATH= string, the message BAD 
  46.      COMMAND OR FILENAME will be displayed.
  47.           The exact same sequence is followed if a running program calls 
  48.      DOS to execute a program but with one possible important difference.  
  49.      For technical reasons, some programs (like FMTMAS) need to load a
  50.      secondary copy of COMMAND.COM and then pass the name of the program to 
  51.      be executed to COMMAND.COM.  This is accomplished by searching the 
  52.      environment string for the COMSPEC= string to locate COMMAND.COM, 
  53.      changing to that directory, and telling DOS to load COMMAND.COM.  The 
  54.      command passed to DOS might look somethin like this:
  55.  
  56.                            COMMAND.COM MYPROG.EXE
  57.  
  58.      This tells DOS to run COMMAND.COM and for COMMAND.COM to load and 
  59.      execute MYPROG.EXE.  Even if MYPROG.EXE were located in the active 
  60.      directory when the applications program passed this command to DOS, 
  61.      COMMAND.COM might not find MYPROG.EXE because the applications program 
  62.      switched to the directory where COMMAND.COM was located in order to
  63.      start things rolling.  Therefore, unless MYPROG.EXE was in a directory 
  64.      contained in the PATH= string or in the same directory as COMMAND.COM, 
  65.      DOS would not find it.
  66.          FormatMaster depends upon the presence of SYS.COM transfer system
  67.      files to a freshly formatted diskette.  It calls SYS.COM by using the
  68.      command sequence just described and therefore cannot transfer the
  69.      files if DOS cannot find SYS.COM when called to load it.  Suppose 
  70.      SYS.COM resides in a directory named C:\DOS.  Placing the following 
  71.      command in your AUTOEXEC.BAT file and rebooting will ensure that 
  72.      SYS.COM can be found when needed:
  73.  
  74.                              PATH=C:\DOS
  75.  
  76.      Obviously, the PATH= string can contain other directory path names and 
  77.      you may already have a PATH= command in your AUTOEXEC.BAT file.  If 
  78.      so, just add the directory containing the archive system files to the 
  79.      string.  For maximum speed, make it the first directory name in the 
  80.      string.
  81.           When FormatMaster loads it will search your system environment
  82.      to find the location of COMMAND.COM.  This is automatic and requires 
  83.      nothing on your part.  The only problem that could occur is in a 
  84.      system that is using a command intreperter other than COMMAND.COM (a 
  85.      **very** rare situation).
  86.  
  87.      You may specify an exact location for FMTMAS.EXE by placing the
  88.      following command in your AUTOEXEC.BAT file:
  89.  
  90.                           set FMLOC=C:\XXXX\...
  91.  
  92.      Where C:\XXXX\... should be replaced the the actual DOS path name
  93.      of the directory in which FMTMAS.EXE is located.  Be SURE to
  94.      place the drive letter and colon in the string!
  95.  
  96.      You may specify that FormatMaster use 9 sectors in lieu of 10
  97.      sectors when formatting a 360K disk in a 1.2 drive.  This will
  98.      force FormatMaster to format a 360K disk to 720K instead of 800K
  99.      for those systems where the 800K option will not work.  Place the
  100.      following command in the AUTOEXEC.BAT file:
  101.  
  102.                           set FMSEC=9
  103.  
  104.      NOTE:  It is **important** that DOS 2.x users use CAPS when entering
  105.             path commands into the environment.  DOS 3.x automatically
  106.             changes all characters to upper case but DOS 2.x does not.
  107.  
  108.      Copyright 1988/89/90 by New-Ware, All Rights Reserved.
  109.